package com.littrabble.proxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class LogHandler implements InvocationHandler {

	private Object delegate;

	public Object invoke(Object proxy, Method method, Object[] args)
			throws Throwable {
		Object result = null;

		try {
			result = method.invoke(delegate, args);
		} catch (Exception e) {
			System.out.println(e.toString());
		}

		return result;
	}

	public Object getDelegate() {
		return delegate;
	}

	public void setDelegate(Object delegate) {
		this.delegate = delegate;
	}

}
